//
//  YPCollectionViewCellForFoundButton.m
//  ttpod
//
//  Created by 孙贻鹏 on 16/3/22.
//  Copyright © 2016年 Scott. All rights reserved.
//

#import "YPCollectionViewCellForFoundButton.h"
#import <UIImageView+WebCache.h>
#import "YPModelForFound.h"

@interface YPCollectionViewCellForFoundButton ()

@property (nonatomic, retain)UILabel *label;
@property (nonatomic, retain)UIImageView *imageView;

@end


@implementation YPCollectionViewCellForFoundButton

- (instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    
    if (self) {
        
        [self createSubview];
    }
    return self;
}

- (void)createSubview {
    
    self.label = [[UILabel alloc] init];
    self.label.textAlignment = 1;
    self.label.font = [UIFont systemFontOfSize:13];
    [self addSubview:self.label];
    
    self.imageView = [[UIImageView alloc] init];
    [self addSubview:self.imageView];
}

- (void)layoutSubviews {
    
    self.imageView.frame = CGRectMake(18, 10, self.frame.size.width - 36, self.frame.size.height / 3 * 2 - 10);
    self.label.frame = CGRectMake(0, self.frame.size.height / 3 * 2 + 5, self.frame.size.width, self.frame.size.height / 3 - 5);
}

- (void)passModelForFoundButtonCol:(NSDictionary *)dic {
    
    self.label.text = [dic objectForKey:@"name"];
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:[dic objectForKey:@"picUrl"]]];
    
}




@end
